/*
 * Created on Jun 30, 2007
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.basic;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.beanutils.ConvertUtils;

import com.frame.struts.ActionContext;
import com.frame.struts.BaseBean;
import com.utils.*;

/**
 * @author IBM_USER
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class QxForm extends BaseBean {
	QxEntry qx = new QxEntry();
	
	  static{
	        ConvertUtils.register(new DateConverter(), Date.class);
	    }
	
	public String addQxxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		BasicFactory factory = BasicFactory.getInstance();
		qx.setOptrid(CommUtil.getUserId(request));
		qx.setXh(factory.getNextXh("qy_qxxx", qyid));
		try{
			   if (factory.addQxxx(qx)) {
				   response.sendRedirect("/basic/qxxx.jsp");
			   }
			   else
			   {
			    	response.sendRedirect("/basic/failed.jsp");
			   }
			}
			catch (Exception e) {

			}

			return null;
		//factory.addQxxx(qx);
		
	}
	public String editQxxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		BasicFactory factory = BasicFactory.getInstance();
		qx.setQyid(CommUtil.getUserId(request));
		//qx.setXh(factory.getNextXh("qy_qxxx", qyid));
		try{
			if(factory.editQxxx(qx)){
				response.sendRedirect("/basic/qxxx.jsp");
			}
			else
			{
			    response.sendRedirect("/basic/failed.jsp");
			}
		}
		catch (Exception e) {

		}

	    return null;
		//factory.editQxxx(qx);
		//return "qxxx";
	}
public String addBlxdxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		BasicFactory factory = BasicFactory.getInstance();
		qx.setOptrid(CommUtil.getUserId(request));
		qx.setXh(factory.getNextXh("qy_blxdxx", qyid));
		try{
			   if (factory.addBlxdxx(qx)) {
				   response.sendRedirect("/basic/blxdxx.jsp");
			   }
			   else
			   {
			    	response.sendRedirect("/basic/failed.jsp");
			   }
			}
			catch (Exception e) {

			}

			return null;
		//factory.addBlxdxx(qx);
		//return "qxxx";
	}

public String editBlxdxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		BasicFactory factory = BasicFactory.getInstance();
		qx.setQyid(CommUtil.getUserId(request));
		//qx.setXh(factory.Xh("qy_blxdxx", qyid));
		try{
			   if (factory.editBlxdxx(qx)) {
				   response.sendRedirect("/basic/blxdxx.jsp");
			   }
			   else
			   {
			    	response.sendRedirect("/basic/failed.jsp");
			   }
			}
			catch (Exception e) {

			}

			return null;
		//factory.editBlxdxx(qx);
		//return "blxdxx";
	}
	public String delQxxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		BasicFactory factory = BasicFactory.getInstance();
		factory.delQxxx(qx.getXh());
		return "qxxx";
	}
	public String delBlxdxx() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		BasicFactory factory = BasicFactory.getInstance();
		factory.delBlxdxx(qx.getXh());
		return "blxdxx";
	}
	

	public int getBs() {
		return qx.getBs();
	}

	public String getJbh() {
		return qx.getJbh();
	}

	public double getJe() {
		return qx.getJe();
	}
	


	public Date getOptdate() {
		return qx.getOptdate();
	}

	public String getOptrid() {
		return qx.getOptrid();
	}


	public String getQyid() {
		return qx.getQyid();
	}

	public String getRecstate() {
		return qx.getRecstate();
	}

	public String getRemark() {
		return qx.getRemark();
	}

	public int getXh() {
		return qx.getXh();
	}

	public void setBs(int bs) {
		qx.setBs(bs);
	}

	public void setJbh(String jbh) {
		qx.setJbh(jbh);
	}

	public void setJe(double je) {
		qx.setJe(je);
	}
	



	public void setOptdate(Date optdate) {
		qx.setOptdate(optdate);
	}

	public void setOptrid(String optrid) {
		qx.setOptrid(optrid);
	}


	public void setQyid(String qyid) {
		qx.setQyid(qyid);
	}

	public void setRecstate(String recstate) {
		qx.setRecstate(recstate);
	}

	public void setRemark(String remark) {
		qx.setRemark(remark);
	}

	public void setXh(int xh) {
		qx.setXh(xh);
	}
	public java.sql.Date getQxsj() {
		return qx.getQxsj();
	}
	public void setQxsj(java.sql.Date qxsj) {
		qx.setQxsj(qxsj);
	}
	public java.sql.Date getYqsj() {
		return qx.getYqsj();
	}
	public void setYqsj(java.sql.Date yqsj) {
		qx.setYqsj(yqsj);
	}
	
	public String getXm() {
		return qx.getXm();
	}
	public void setXm(String xm) {
		qx.setXm(xm);
	}
}
